home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_gen / t4diblib.zip / ANIMATE5.F3_ / ANIMATE5.F3
Text File  |  1995-11-14  |  3KB  |  123 lines

  1. VERSION 2.00
  2. Begin Form Form1
  3.    Caption         =   "ANIMATE5"
  4.    ClientHeight    =   1680
  5.    ClientLeft      =   1200
  6.    ClientTop       =   1572
  7.    ClientWidth     =   2880
  8.    Height          =   2100
  9.    Left            =   1152
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   1680
  12.    ScaleWidth      =   2880
  13.    Top             =   1200
  14.    Width           =   2976
  15.    Begin T4DILIB dilib1
  16.       Caption         =   "dilib1"
  17.       ControlMode     =   0  'Lib -> PIC
  18.       Height          =   372
  19.       Index           =   4
  20.       Left            =   1680
  21.       Top             =   960
  22.       Visible         =   0   'False
  23.       Width           =   972
  24.    End
  25.    Begin T4DILIB dilib1
  26.       Caption         =   "dilib1"
  27.       ControlMode     =   0  'Lib -> PIC
  28.       Height          =   372
  29.       Index           =   3
  30.       Left            =   1560
  31.       Top             =   840
  32.       Visible         =   0   'False
  33.       Width           =   972
  34.    End
  35.    Begin T4DILIB dilib1
  36.       Caption         =   "dilib1"
  37.       ControlMode     =   0  'Lib -> PIC
  38.       Height          =   372
  39.       Index           =   2
  40.       Left            =   1440
  41.       Top             =   720
  42.       Visible         =   0   'False
  43.       Width           =   972
  44.    End
  45.    Begin T4DILIB dilib1
  46.       Caption         =   "dilib1"
  47.       ControlMode     =   0  'Lib -> PIC
  48.       Height          =   372
  49.       Index           =   1
  50.       Left            =   1320
  51.       Top             =   600
  52.       Visible         =   0   'False
  53.       Width           =   972
  54.    End
  55.    Begin CommandButton Command1
  56.       Caption         =   "&Quit"
  57.       Height          =   372
  58.       Left            =   120
  59.       TabIndex        =   0
  60.       Top             =   1200
  61.       Width           =   1452
  62.    End
  63. End
  64. Option Explicit
  65. Declare Function GlobalFree% Lib "kernel" (ByVal h%)
  66. Declare Function GetFreeSpace& Lib "kernel" (ByVal x%)
  67. Dim TimeIn!
  68. Dim Frames%
  69.  
  70. Sub Command1_Click ()
  71.  Terminate
  72. End Sub
  73.  
  74. Sub Form_Load ()
  75. Dim loopctr%, memctr%, framectr%
  76.  Top = (screen.Height - Height) / 2!
  77.  Left = (screen.Width - Width) / 2!
  78. 'dilib(1) has the 'real' hLib
  79.  dilib1(1).LibraryName = "bluespin.ilb"
  80.  dilib1(1).Action = IM_ACTION_OPENLIBRARY
  81.  Show
  82.  Frames = 0
  83.  TimeIn = Timer
  84.  For memctr = 1 To 4
  85.   If memctr > 1 Then
  86. 'Clone the hLib into dilibs 2-4.
  87.    dilib1(memctr).hLib = dilib1(1).hLib
  88.   End If
  89. 'One image per dilib1.
  90.   dilib1(memctr).MemberNumber = memctr
  91.   dilib1(memctr).Action = IM_ACTION_GETMEMBER
  92.  Next
  93.  For loopctr = 1 To 100
  94.   For memctr = 1 To 4
  95.    'Disregard comments for tutorial.
  96.    'Moving image
  97.    'image1.Left = image1.Left + screen.TwipsPerPixelX
  98.    'image1.Top = image1.Top + screen.TwipsPerPixelY
  99.    'image1.Picture = dilib1(memctr).Picture
  100.    'image1.Refresh
  101.    Picture = dilib1(memctr).Picture
  102.    Frames = Frames + 1
  103.   Next memctr
  104.   DoEvents
  105.  Next loopctr
  106.  Terminate
  107. End Sub
  108.  
  109. Sub Form_Unload (Cancel As Integer)
  110.  End
  111. End Sub
  112.  
  113. Sub Terminate ()
  114. Dim TimeOut!, TimeElapsed!, fps!
  115.  TimeOut = Timer
  116.  TimeElapsed = TimeOut - TimeIn
  117.  fps = Frames
  118.  fps = Frames / TimeElapsed
  119.  MsgBox Trim$(Str$(fps)) + " frames per second."
  120.  End
  121. End Sub
  122.  
  123.